<!DOCTYPE html>
<!-- saved from url=(0073)http://www.chuanke.com/?mod=student&act=credit&do=voteCourse&oid=18374465 -->
<html lang="zh-cmn-Hans">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>学知识，上百度传课</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="keywords" content="百度传课,KK,新思诺,英语,在线课堂,远程教育,在线学习,视频课程,公开课,电子商务,信息分享,职场培训,直播课堂,免费听课,名师网络课程,名师网课,B2B">
    <meta name="description" content="百度传课，中国最大的网络课程在线分享平台。您可在线传授技能，亦可在线学习你所需的一技之长。内容涉及英语学习、职场培训、生活技巧等任何技能。">
    <link rel="shortcut icon" href="http://www.chuanke.com/favicon.ico">
    <link href="http://res.ckimg.com/common/v1/images/favicon.ico" type="/image/x-icon" rel="icon">
    <link rel="stylesheet" href="css/evaluate/reset.css">
    <link rel="stylesheet" href="css/base/base.css">
    <link rel="stylesheet" href="css/evaluate/evaluate.css">
    <script src="js/jquery-1.8.3.min.js"></script>
    <script src="js/jquery.common.js"></script>
    <script src="js/html5.js"></script>

</head>
<body class="pageStudent">
<!-- Start 主内容 -->
<div class="content cf">
    <div class="evaluate-compose">
        <div class="fl e-compose-pic">
            <img src="./评价课程_files/489148b89aa69e3df2d768494bc370ab.jpg" alt="">
            <h3 class="title">贵州省威宁县金星小学三年级数学</h3>
            <p class="c-orange"><em class="money">¥</em> 0.00</p>
        </div>
        <ul class="e-compose-order">
            <li class="item"><span class="fl label"><em class="c-reg">*</em> 课程打分：</span>
                <label class="radio" aid="1">
                    <i class="ico-radio"><input type="radio" id="appraise1" name="appraise" value="1"></i>
                    <span class="text"><i class="ico-grade-star s1"></i> 好评</span>
                </label>
                <label class="radio" aid="2">
                    <i class="ico-radio"><input type="radio" id="appraise2" name="appraise" value="2"></i>
                    <span class="text"><i class="ico-grade-star s2"></i> 中评</span>
                </label>
                <label class="radio" aid="3">
                    <i class="ico-radio"><input type="radio" id="appraise3" name="appraise" value="3"></i>
                    <span class="text"><i class="ico-grade-star s3"></i> 差评</span>
                </label>
            </li>
            <li class="item"><span class="fl label tag">评价标签：</span>
                <ul class="comment-tag">
                    <li tid="1" class="vote_tags">视频画面清晰</li>
                    <li tid="2" class="vote_tags">课程内容不错</li>
                    <li tid="3" class="vote_tags">老师讲的很好</li>
                    <li tid="4" class="vote_tags">期待后续更新</li>
                    <li tid="5" class="vote_tags">实用性很强</li>
                    <li tid="6" class="vote_tags">简单易懂</li>
                    <li tid="7" class="vote_tags">互动性强</li>
                    <li tid="8" class="vote_tags">赞一个</li>
                    <li tid="9" class="vote_tags">有收获</li>
                </ul>
                <span id="tags_tips" class="tips" style="display:none;">最多能打3个标签哦,思考一下~</span>
            </li>
            <li class="item"><span class="fl label">课程评价：</span>
                <div class="fl com-area-box ">
                    <textarea class="com-area " name="vote_text" id="vote_text"></textarea>
                </div>
                <div class="fl anonymous">
                    <span class="fl num c-999">字数<em class="c-orange">250</em>字以内 </span>
                    <label class="fr checkbox2" id="label-checkbox">
                        <i class="ico-checkbox2">
                            <input type="checkbox" id="anoy" name="anoy">
                            <input type="hidden" id="oid" value="18374465">
                        </i>
                        <span class="text">匿名评价</span>
                    </label>
                </div>
            </li>
            <li>
                <button class="ck-btn ck-btn3" id="saveBtn">确认提交</button>
            </li>
        </ul>
    </div>
</div>

<script>
    $(function () {
        $(".vote_tags").click(function () {
            var obj = $(this);
            if (obj.hasClass('select')) {
                $('#tags_tips').hide();
                obj.removeClass('select');
            } else {
                if ($(".comment-tag").find(".select").length >= 3) {
                    $('#tags_tips').show();
                    return false;
                }
                obj.addClass('select');
            }
        });

        $("label.radio").click(function () {
            var obj = $(this);
            $(".radio").removeClass('checked');
            obj.addClass('checked');
            $(":input[name='appraise'][value='" + obj.attr('aid') + "']").attr("checked", "checked");
        });

        $("#label-checkbox").toggle(
                function () {
                    $(this).addClass('checked');
                    $("#anoy").attr('checked', 'checked');
                },
                function () {
                    $(this).removeClass('checked');
                    $("#anoy").removeAttr('checked');
                }
        );

        $("#saveBtn").click(function () {
            var $obj = $(this);
            var oid = $("#oid").val();
            var appraise = $(":input[name='appraise'][checked='checked']").val();

            if ($obj.attr("disabled") == "1") {
                return false;
            }

            if (!appraise) {
                alert('请给课程打分');
                return false;
            }

            var vote_text = $("#vote_text").val();
            if (vote_text.length > 250) {
                alert('请把评价字数控制在1-250字以内');
                return false;
            }
            var is_anoy = 0;
            if ($("#anoy").attr('checked') == 'checked') {
                is_anoy = 1;
            }

            var tag_list = new Array();
            $(".comment-tag").find(".select").each(function () {
                tag_list.push($(this).attr('tid'));
            });

            if (tag_list.length > 3) {
                $('#tags_tips').show();
                return false;
            }

            $.ajax({
                url: '/?mod=student&act=credit&do=saveVoteCourse',
                type: 'post',
                data: 'oid=' + oid + '&appraise=' + appraise + '&vote_text=' + encodeURIComponent(vote_text) + '&is_anoy=' + is_anoy + '&tags=' + tag_list.join(","),
                dataType: 'json',
                beforeSend: function () {
                    $obj.attr("disabled", "1");
                    loadingSubBox = $.ckTipsBoxy({type: "loading", message: "保存中...", mask: true});
                },
                success: function (ret) {
                    $obj.removeAttr("disabled");
                    if (ret.code == 0) {
                        location.href = "/?mod=student&act=credit&do=voteSuccess&oid=" + oid;
                    } else {
                        alert(ret.data);
                    }
                }
            });
        });
    });
</script>
</body>
</html>